<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('基价修改管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
    	<h4 class="form-header h4" style="margin: 10px 10px 0px 10px;">物料信息</h4>
        <form class="form-horizontal m" id="form-material-edit" th:object="${gysptMaterial}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-1 control-label">物料类别：</label>
                <div class="col-sm-2">
                	<label th:text="*{typeName}" class="control-label"></label>
                </div>
                <label class="col-sm-1 control-label">物料编号：</label>
                <div class="col-sm-2">
                    <label th:text="*{typebh}" class="control-label"></label>
                </div>
                <label class="col-sm-1 control-label">物料名称：</label>
                <div class="col-sm-2">
                	<label th:text="*{mingc}" class="control-label"></label>
                </div>
                <label class="col-sm-1 control-label">物料品牌：</label>
                <div class="col-sm-2">
                	<label th:text="*{clpp}" class="control-label"></label>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-1 control-label">规格型号：</label>
                <div class="col-sm-2">
                	<label th:text="*{guig}" class="control-label"></label>
                </div>
                <label class="col-sm-1 control-label">单位：</label>
                <div class="col-sm-2">
                	<label th:text="*{danw}" class="control-label"></label>
                </div>
                <label class="col-sm-1 control-label">系统指导价（不含税）：</label>
                <div class="col-sm-2">
                	<label th:text="*{zdjine}" class="control-label"></label>
                </div>
                <label class="col-sm-1 control-label is-required">修改价格：</label>
                <div class="col-sm-2">
                	<input name="zdjine" th:value="${jjxgdanj}" class="form-control" type="text" required="required">
                </div>
            </div>
        </form>
        <h4 class="form-header h4" style="margin: 10px 10px 0px 10px;">供应商报价信息</h4>
        <div class="row">
            <div class="col-sm-12">
    			<table id="bootstrap-table-purchase"></table>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
          	<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>提 交</button>&nbsp;
          	<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
	    var prefix = ctx + "gcgl/material"
	    $("#form-material-edit").validate({
	        focusCleanup: true
	    });
    
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.saveTab(prefix + "/editWh", $('#form-material-edit').serialize());
            }
        }
        
        //订单---
		var data = [[${purchaseitemlis}]];
		$(function() {
            var options = {
            	id: "bootstrap-table-purchase",
        		data: data,
                pagination: false,
		        showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
		        columns: [
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'clfl',
                    title: '物料类别',
                },
                {
                    field: 'clbh',
                    title: '物料编号',
                },
                {
                    field: 'mingc',
                    title: '物料名称',
                    width: '200px'
                },
                {
                    field: 'clpp',
                    title: '物料品牌',
                },
                {
                    field: 'guig',
                    title: '规格型号',
                    width: '400px'
                },
                {
                    field: 'danw',
                    title: '单位',
                },
                {
                    field: 'danj',
                    title: '单价'
                },
                {
                    field: 'supplyName',
                    title: '供应商名称'
                },
                {
                    field: 'createAt',
                    title: '报价时间'
                }]
            };
            $.table.init(options);
        });
		
		function orderDetail(id){
            $.modal.openTab('订单确认后详情',"/gcgl/order/detail/"+id);
        }
    </script>
</body>
</html>